/*
Copyright 2010 SGSL

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


package com.dataiti.sgsl;
import java.awt.Color;

/**
 * The units of all latitudes and longitudes are in decimal degrees as type
 * double.
 * 
 */
public interface ISGSL {

	/**
	 * erase or start over.
	 */
	void eraseGraphic();

	/**
	 * Width and height of illustration (that is, it is zoomed to show this much
	 * of the earth).
	 * 
	 * @param sz
	 *            The width and height are both given by this single parameter
	 *            in decimal degrees.
	 */
	void setWidthAndHeight(double sz);

	/**
	 * illustration is centered at this lat and lon. North pole is always top
	 * center if not on the graphic, and on a vertical centerline of the graphic
	 * if it appears on the graphic.
	 * 
	 * @param lat
	 * @param lon
	 */
	void setCenter(double lat, double lon);

	/**
	 * displays the continent & country boundary map.
	 */
	void setBackground(boolean visible);

	/**
	 * displays the grid lines of the projection.
	 */
	void setGridLines(boolean visible);

	/**
	 * set current drawing position to lat and lon
	 * 
	 * @param lat
	 * @param lon
	 */
	void setDrawingPosition(double lat,double lon);

	/**
	 * size of text displayed on illustration. This is NOT a font size. It is
	 * measured as a fraction of the graphical panel size. Example 0.05 means
	 * the letters are about 5% of the height of the entire graphical panel.
	 * They should be the largest font size whose height is smaller than this
	 * fraction of the height of the entire graphical panel. The maximum
	 * textHeightFraction can be limited to 0.10.
	 * 
	 * @param textHeightFraction
	 */
	void setLabelSize(double textHeightFraction);

	/**
	 * display string as a label at current position on the illustration (First
	 * character displays 2 millimeteres to the right of the position to avoid
	 * being right on top of the position.)
	 * 
	 * @param string
	 */
	void drawLabel(String string); // 

	/**
	 * change current color. Color code is an instance of an enum void Color
	 * having values specified below. Applies to both text and lines.
	 * 
	 * @param color
	 */
	void setColor(Color color);

	/**
	 * display filled circle centered at current position
	 * 
	 * @param radius
	 */
	void drawPoint();

	/**
	 * display empty circle centered at current position
	 * 
	 * @param radius
	 */
	void drawCircle(double radius);

	/**
	 * display arc of great circle connecting two points.
	 * 
	 * @param startLat
	 * @param startLon
	 * @param endLat
	 * @param endLon
	 */
	void drawArc(double startLat, double startLon, double endLat, double endLon);

	/**
	 * display arc of great circle originating at current position, angle is
	 * decimal degrees (zero is due north, 90 is due east), length is decimal
	 * degrees of length of arc. 360.0 would be a full great circle around the
	 * earth.
	 * 
	 * @param angle
	 * @param length
	 */
	void drawArc(double angle, double length);

	/**
	 * print a message on the lower panel of the applet. On screen - grows a
	 * scroll bar if there are lots of messages. Font and size are as would be
	 * created by default by System.out.println().
	 * 
	 * @param string
	 */
	void printMessage(String string);

	/**
	 * print applet on paper. The usual platform-dependent print dialog should
	 * help select the printer which can be any kind of printing device
	 * supporting standard paper sizes (US Letter required at minimum). There
	 * should be nothing stopping the user from printing to a PDF writer so they
	 * get a file they can easily save, email as an attachment, etc. The print
	 * out would include the graphic illustration, and the message panel below
	 * it, continuing on additional pages to fit all messages.
	 */
	void printPage();
	
	
	
	void drawFilledCircle(double radius);

	/**
	 * Convenient color constants for drawing.
	 */
	static Color black = Color.black;
	static Color blue = Color.blue;
	static Color darkGray = Color.darkGray;
	static Color gray = Color.gray;
	static Color green = Color.green;
	static Color lightGray = Color.lightGray;
	static Color magenta = Color.magenta;
	static Color orange = Color.orange;
	static Color pink = Color.pink;
	static Color red = Color.red;
	static Color white = Color.white;
	static Color yellow = Color.yellow;
}
